﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net;
using System.IO;

namespace Htinns.GatewayConsole.Models
{
	public class HomeModel:ModelBase
	{
		public static string GetHotelName(string hotelId)
		{
			//
			var httpStr = "http://www.htinns.com/market/getHotelName.aspx?hotelid="+hotelId;

			string hotelName=string.Empty;

			try
			{
				HttpWebRequest req = (HttpWebRequest)WebRequest.Create(httpStr);

				//req.ReadWriteTimeout = 3000;//设置写入超时
				req.Timeout = 3000;//设置读取超时

				HttpWebResponse resp  = (HttpWebResponse)req.GetResponse();

				Stream receiveStream = resp.GetResponseStream();

				StreamReader reader = new StreamReader(receiveStream, System.Text.Encoding.UTF8);

				hotelName = reader.ReadToEnd();
			}
			finally {				
			}

			return hotelName;
		}
	}	
}